<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div.top{
            height: 50px;
            border: 1px solid red;
        }
        div.bottom div{
            float: left;
        }
        div.left{
            width: 170px;
            border: 1px solid black;
        }
        div.right{
            border: 1px solid blue;
        }
        p{
            background-color: #ccc;
            width: 100px;
            height: 40px;
            text-align: center;
            line-height: 40px;
            margin:20px auto;
            border-radius: 10px;
        }
        p:hover{
            cursor: pointer;
        }
    </style>
    <script src="./jquery-3.5.0/jquery-3.5.0.js"></script>
    <script>
        $(function(){
            //1.设置侧边栏高度
            var height=$(window).height()-70;//获取当前可视区域的高度
            var width=$(window).width()-190;
            $('div.left').css('height',height);
            $('div.right').css('height',height);
            $('div.right').css('width',width);
            //2.给按钮绑定事件
            $('p').click(function(){
                //去除所有按钮背景样式
                $('p').css('background-color','#ccc');
                //给当前点击按钮添加背景色
                $(this).css('background-color','pink');
                var text=$(this).text();
                var url='./'+text+'.html';
                $('div.right').load(url);
            });
            $('p:first').trigger('click');
        })
    </script>
</head>
<body>
    <div class="top"></div>
    <div class="bottom">
        <div class="left">
            <p>首页</p>
            <p>学生管理</p>
            <p>教师管理</p>
            <p>选课管理</p>
        </div>
        <div class="right">
            <!-- 动态加载代码片段 -->
        </div>
    </div>
</body>
</html>